package com.youlai.boot.system.converter;

import com.youlai.boot.system.converter.worker.TypeConversionWorker;
import com.youlai.boot.system.model.vo.ProjectVO;
import org.mapstruct.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.system.model.entity.Project;
import com.youlai.boot.system.model.form.ProjectForm;
import org.mapstruct.Mapping;

/**
 * 项目实践对象转换器
 *
 * @author hypersense
 * @since 2025-03-14 22:49
 */
@Mapper(componentModel = "spring", uses = TypeConversionWorker.class)
public interface ProjectConverter{

    @Mapping(target = "techs",source = "techs",qualifiedByName = "toStrList")
    ProjectForm toForm(Project entity);

    @Mapping(target = "techs",source = "techs",qualifiedByName = "toJsonString")
    Project toEntity(ProjectForm formData);

    @Mapping(target = "techs",source = "techs",qualifiedByName = "toStrList")
    ProjectVO toProjectVo(Project entity);
}